package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;

public class Examen implements Serializable {

	private static final long serialVersionUID = 9219272346894792271L;
	
	private int numExamen;
	private String libelle;
	private String horaire;
	private Type type;
	private Jours dateExamen;
	private EC ec;
	private Collection<Note> listesNotes;
	private Collection<Etudiant> listeEtudiants;
	
	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public Examen() {}
	
	public Examen(int numExamen, String libelle, String horaire, Type type,
			Jours dateExamen, EC ec) {
		super();
		this.numExamen = numExamen;
		this.libelle = libelle;
		this.horaire = horaire;
		this.type = type;
		this.dateExamen = dateExamen;
		this.ec = ec;
		this.listeEtudiants = null;
		this.listesNotes = null;
	}

	public EC getEc() {
		return ec;
	}

	public void setEc(EC ec) {
		this.ec = ec;
	}

	public Collection<Note> getListesNotes() {
		return listesNotes;
	}

	public void setListesNotes(Collection<Note> listesNotes) {
		this.listesNotes = listesNotes;
	}

	public Collection<Etudiant> getListeEtudiants() {
		return listeEtudiants;
	}

	public void setListeEtudiants(Collection<Etudiant> listeEtudiants) {
		this.listeEtudiants = listeEtudiants;
	}

	public Jours getDateExamen() {
		return dateExamen;
	}

	public void setDateExamen(Jours dateExamen) {
		this.dateExamen = dateExamen;
	}

	public int getNumExamen() {
		return numExamen;
	}
	
	public void setNumExamen(int numExamen) {
		this.numExamen = numExamen;
	}
	
	public String getLibelle() {
		return libelle;
	}
	
	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}
	
	public String getHoraire() {
		return horaire;
	}
	
	public void setHoraire(String horaire) {
		this.horaire = horaire;
	}
	
	public Type getType() {
		return type;
	}
	
	public void setType(Type type) {
		this.type = type;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
